<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.16"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>LibTools: H:/project/LibTools/src/socket/Timer.cpp 源文件</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">LibTools
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- 制作者 Doxygen 1.8.16 -->
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',false,false,'search.php','搜索');
});
/* @license-end */</script>
<div id="main-nav"></div>
<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_68267d1309a1af8e8297ef4c3efbcdba.html">src</a></li><li class="navelem"><a class="el" href="dir_9ad1227260954e346101f3844f0abb3d.html">socket</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="headertitle">
<div class="title">Timer.cpp</div>  </div>
</div><!--header-->
<div class="contents">
<a href="_timer_8cpp.html">浏览该文件的文档.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="_timer_info_8h.html">./internal/TimerInfo.h</a>&quot;</span></div>
<div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="_service_base_8h.html">ServiceBase.h</a>&quot;</span></div>
<div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="_timer_8h.html">Timer.h</a>&quot;</span></div>
<div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160; </div>
<div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;<a class="code" href="tools_8h.html#a201ce692c9dca6599e5c12d00167419b">DEF_BEG_LIBTOOLS</a></div>
<div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160; </div>
<div class="line"><a name="l00007"></a><span class="lineno"><a class="line" href="class_c_timer_base.html#ad54d1b32d19918127ef78ce3864f59b8">    7</a></span>&#160;<a class="code" href="class_c_timer_base.html#ad54d1b32d19918127ef78ce3864f59b8">CTimerBase::CTimerBase</a>(<a class="code" href="class_c_basic_service.html">CBasicService</a>* service)</div>
<div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;{</div>
<div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;    <a class="code" href="class_c_timer_base.html#aa1353bd6bbfb8fa4a045c4f091ab09e6">_service</a> = service;</div>
<div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;}</div>
<div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160; </div>
<div class="line"><a name="l00012"></a><span class="lineno"><a class="line" href="class_c_timer_base.html#ac635b2ee072a0ccca975d084c0b48f51">   12</a></span>&#160;<a class="code" href="class_c_timer_base.html#ac635b2ee072a0ccca975d084c0b48f51">CTimerBase::~CTimerBase</a>()</div>
<div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;{</div>
<div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160;    <span class="keywordflow">if</span> (<a class="code" href="class_c_timer_base.html#a45d900ea34b698a1cca78c92a5c5a18d">_tinfo</a>) {</div>
<div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160;        <a class="code" href="class_c_timer_base.html#aa1353bd6bbfb8fa4a045c4f091ab09e6">_service</a>-&gt;<a class="code" href="class_c_basic_service.html#a84db55709c4a577a12879202e2788727">DelTimer</a>(*<span class="keyword">this</span>);</div>
<div class="line"><a name="l00016"></a><span class="lineno">   16</span>&#160;    }</div>
<div class="line"><a name="l00017"></a><span class="lineno">   17</span>&#160;    <a class="code" href="class_c_timer_base.html#aa1353bd6bbfb8fa4a045c4f091ab09e6">_service</a> = <a class="code" href="tools_8h.html#ab689500aaec0db066e3ac9483d3fe425">NullPtr</a>;</div>
<div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160;}</div>
<div class="line"><a name="l00019"></a><span class="lineno">   19</span>&#160; </div>
<div class="line"><a name="l00020"></a><span class="lineno"><a class="line" href="class_c_timer_base.html#a65fe573e241729a9f62bc6757da9f36a">   20</a></span>&#160;<span class="keywordtype">bool</span> <a class="code" href="class_c_timer_base.html#a65fe573e241729a9f62bc6757da9f36a">CTimerBase::Cancel</a>()</div>
<div class="line"><a name="l00021"></a><span class="lineno">   21</span>&#160;{</div>
<div class="line"><a name="l00022"></a><span class="lineno">   22</span>&#160;    <span class="keywordflow">if</span> (<a class="code" href="class_c_timer_base.html#a45d900ea34b698a1cca78c92a5c5a18d">_tinfo</a>)</div>
<div class="line"><a name="l00023"></a><span class="lineno">   23</span>&#160;    {</div>
<div class="line"><a name="l00024"></a><span class="lineno">   24</span>&#160;        <a class="code" href="class_c_timer_base.html#a45d900ea34b698a1cca78c92a5c5a18d">_tinfo</a>-&gt;timeout = 0;</div>
<div class="line"><a name="l00025"></a><span class="lineno">   25</span>&#160;        <span class="keywordflow">return</span> <a class="code" href="class_c_timer_base.html#aa1353bd6bbfb8fa4a045c4f091ab09e6">_service</a>-&gt;<a class="code" href="class_c_basic_service.html#ab87e91381edc59c3118e3cfc89f82f76">UpdateTimer</a>(*<span class="keyword">this</span>);</div>
<div class="line"><a name="l00026"></a><span class="lineno">   26</span>&#160;    }</div>
<div class="line"><a name="l00027"></a><span class="lineno">   27</span>&#160; </div>
<div class="line"><a name="l00028"></a><span class="lineno">   28</span>&#160;    <span class="keywordflow">return</span> <span class="keyword">false</span>;</div>
<div class="line"><a name="l00029"></a><span class="lineno">   29</span>&#160;}</div>
<div class="line"><a name="l00030"></a><span class="lineno">   30</span>&#160; </div>
<div class="line"><a name="l00031"></a><span class="lineno"><a class="line" href="class_c_timer_base.html#ae8f782500c3f8ade2436dbd8189f0328">   31</a></span>&#160;<span class="keywordtype">bool</span> <a class="code" href="class_c_timer_base.html#ae8f782500c3f8ade2436dbd8189f0328">CTimerBase::Reset</a>()</div>
<div class="line"><a name="l00032"></a><span class="lineno">   32</span>&#160;{</div>
<div class="line"><a name="l00033"></a><span class="lineno">   33</span>&#160;    <span class="keywordflow">if</span> (<a class="code" href="class_c_timer_base.html#a45d900ea34b698a1cca78c92a5c5a18d">_tinfo</a>)</div>
<div class="line"><a name="l00034"></a><span class="lineno">   34</span>&#160;    {</div>
<div class="line"><a name="l00035"></a><span class="lineno">   35</span>&#160;        <span class="keywordflow">return</span> <a class="code" href="class_c_timer_base.html#aa1353bd6bbfb8fa4a045c4f091ab09e6">_service</a>-&gt;<a class="code" href="class_c_basic_service.html#ab87e91381edc59c3118e3cfc89f82f76">UpdateTimer</a>(*<span class="keyword">this</span>);</div>
<div class="line"><a name="l00036"></a><span class="lineno">   36</span>&#160;    }</div>
<div class="line"><a name="l00037"></a><span class="lineno">   37</span>&#160; </div>
<div class="line"><a name="l00038"></a><span class="lineno">   38</span>&#160;    <span class="keywordflow">return</span> <span class="keyword">false</span>;</div>
<div class="line"><a name="l00039"></a><span class="lineno">   39</span>&#160;}</div>
<div class="line"><a name="l00040"></a><span class="lineno">   40</span>&#160; </div>
<div class="line"><a name="l00041"></a><span class="lineno"><a class="line" href="class_c_timer_base.html#afd4814952f219f10b2f06a73fa9cec7d">   41</a></span>&#160;<a class="code" href="class_c_machine_time.html">CMachineTime</a>* <a class="code" href="class_c_timer_base.html#afd4814952f219f10b2f06a73fa9cec7d">CTimerBase::StartTime</a>(<a class="code" href="class_c_machine_time.html">CMachineTime</a>&amp; t)</div>
<div class="line"><a name="l00042"></a><span class="lineno">   42</span>&#160;{</div>
<div class="line"><a name="l00043"></a><span class="lineno">   43</span>&#160;    <span class="keywordflow">if</span> (<a class="code" href="class_c_timer_base.html#a45d900ea34b698a1cca78c92a5c5a18d">_tinfo</a>)</div>
<div class="line"><a name="l00044"></a><span class="lineno">   44</span>&#160;    {</div>
<div class="line"><a name="l00045"></a><span class="lineno">   45</span>&#160;        t.<a class="code" href="class_c_machine_time.html#a5a9fb922168cf7ebdee0e0ace9ba5896">SetTime</a>(<a class="code" href="class_c_timer_base.html#a45d900ea34b698a1cca78c92a5c5a18d">_tinfo</a>-&gt;GetTimerId());</div>
<div class="line"><a name="l00046"></a><span class="lineno">   46</span>&#160;        <span class="keywordflow">return</span> &amp;t;</div>
<div class="line"><a name="l00047"></a><span class="lineno">   47</span>&#160;    }</div>
<div class="line"><a name="l00048"></a><span class="lineno">   48</span>&#160; </div>
<div class="line"><a name="l00049"></a><span class="lineno">   49</span>&#160;    <span class="keywordflow">return</span> <a class="code" href="tools_8h.html#ab689500aaec0db066e3ac9483d3fe425">NullPtr</a>;</div>
<div class="line"><a name="l00050"></a><span class="lineno">   50</span>&#160;}</div>
<div class="line"><a name="l00051"></a><span class="lineno">   51</span>&#160; </div>
<div class="line"><a name="l00052"></a><span class="lineno"><a class="line" href="class_c_timer_base.html#a6fffc8e98a58289e7ea395cfbf4d73e9">   52</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="class_c_timer_base.html#a6fffc8e98a58289e7ea395cfbf4d73e9">CTimerBase::SetTimer</a>(<span class="keyword">const</span> <a class="code" href="class_c_time_base.html">CTimeBase</a>&amp;t, <span class="keyword">const</span> <a class="code" href="class_shared_ptr.html">SharedPtr&lt;HandleBase&gt;</a>&amp; func, <span class="keywordtype">void</span>* invoker <span class="comment">/* = NullPtr */</span>)</div>
<div class="line"><a name="l00053"></a><span class="lineno">   53</span>&#160;{</div>
<div class="line"><a name="l00054"></a><span class="lineno">   54</span>&#160;    <a class="code" href="tools_8h.html#adbfeae90dcbc6d1e23fc52bb64339f46">DWORD64</a> timeout = 0;</div>
<div class="line"><a name="l00055"></a><span class="lineno">   55</span>&#160;    <span class="keywordflow">if</span> (t.<a class="code" href="class_c_time_base.html#a7212bf7d0361a0136644701c1a562ce1">GetType</a>() == <a class="code" href="class_c_time_base.html#a045344374dbd744e3bc839b31d552b73a9e6af1eb7377cc41cd74c7abd6807bd6">CTimeBase::real_time</a>)</div>
<div class="line"><a name="l00056"></a><span class="lineno">   56</span>&#160;    {</div>
<div class="line"><a name="l00057"></a><span class="lineno">   57</span>&#160;        <a class="code" href="class_c_sys_time.html">CSysTime</a> sysTime;</div>
<div class="line"><a name="l00058"></a><span class="lineno">   58</span>&#160;        timeout = t.<a class="code" href="class_c_time_base.html#a6667eccaa267178c72d64406484e5aff">GetTime</a>() - sysTime.<a class="code" href="class_c_sys_time.html#a7f7125b905195fa3e9ddc3b3191e89d8">GetTime</a>();</div>
<div class="line"><a name="l00059"></a><span class="lineno">   59</span>&#160;    }</div>
<div class="line"><a name="l00060"></a><span class="lineno">   60</span>&#160;    <span class="keywordflow">else</span> <span class="keywordflow">if</span> (t.<a class="code" href="class_c_time_base.html#a7212bf7d0361a0136644701c1a562ce1">GetType</a>() == <a class="code" href="class_c_time_base.html#a045344374dbd744e3bc839b31d552b73ab4ca480006077aa183b9d7602b295a46">CTimeBase::machine_time</a>)</div>
<div class="line"><a name="l00061"></a><span class="lineno">   61</span>&#160;    {</div>
<div class="line"><a name="l00062"></a><span class="lineno">   62</span>&#160;        <a class="code" href="class_c_machine_time.html">CMachineTime</a> machineTime;</div>
<div class="line"><a name="l00063"></a><span class="lineno">   63</span>&#160;        timeout = machineTime.<a class="code" href="class_c_machine_time.html#a0959e18a8f5d2e7812f986f2e88fc682">GetTime</a>() - t.<a class="code" href="class_c_time_base.html#a6667eccaa267178c72d64406484e5aff">GetTime</a>();</div>
<div class="line"><a name="l00064"></a><span class="lineno">   64</span>&#160;    }</div>
<div class="line"><a name="l00065"></a><span class="lineno">   65</span>&#160;    <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l00066"></a><span class="lineno">   66</span>&#160;        timeout = t.<a class="code" href="class_c_time_base.html#a6667eccaa267178c72d64406484e5aff">GetTime</a>();</div>
<div class="line"><a name="l00067"></a><span class="lineno">   67</span>&#160;    }</div>
<div class="line"><a name="l00068"></a><span class="lineno">   68</span>&#160; </div>
<div class="line"><a name="l00069"></a><span class="lineno">   69</span>&#160;    <span class="comment">// 多次调用设置函数则取消前一次的设定</span></div>
<div class="line"><a name="l00070"></a><span class="lineno">   70</span>&#160;    <span class="keywordflow">if</span> (<a class="code" href="class_c_timer_base.html#a45d900ea34b698a1cca78c92a5c5a18d">_tinfo</a>) <a class="code" href="class_c_timer_base.html#a65fe573e241729a9f62bc6757da9f36a">Cancel</a>();</div>
<div class="line"><a name="l00071"></a><span class="lineno">   71</span>&#160; </div>
<div class="line"><a name="l00072"></a><span class="lineno">   72</span>&#160;    <a class="code" href="class_shared_ptr.html">SharedPtr&lt;TimeoutInfo&gt;</a> tinfo(<span class="keyword">new</span> <a class="code" href="_timer_info_8h.html#ad138624af884b17f15fe7c857f59a5c3">TimeoutInfo</a>());</div>
<div class="line"><a name="l00073"></a><span class="lineno">   73</span>&#160;    tinfo-&gt;timeout = timeout;</div>
<div class="line"><a name="l00074"></a><span class="lineno">   74</span>&#160;    tinfo-&gt;<a class="code" href="class___timeout_info__.html#ab87e6474102fccfab419a011948dc677">invoker</a> = invoker;</div>
<div class="line"><a name="l00075"></a><span class="lineno">   75</span>&#160;    tinfo-&gt;timer = <span class="keyword">this</span>;</div>
<div class="line"><a name="l00076"></a><span class="lineno">   76</span>&#160;    tinfo-&gt;<a class="code" href="class___timeout_info__.html#a75511436e169d4fbb15885d6c83b646a">handle</a> = func;</div>
<div class="line"><a name="l00077"></a><span class="lineno">   77</span>&#160; </div>
<div class="line"><a name="l00078"></a><span class="lineno">   78</span>&#160;    <a class="code" href="class_c_timer_base.html#a45d900ea34b698a1cca78c92a5c5a18d">_tinfo</a>.Swap(tinfo);</div>
<div class="line"><a name="l00079"></a><span class="lineno">   79</span>&#160;    <a class="code" href="class_c_timer_base.html#aa1353bd6bbfb8fa4a045c4f091ab09e6">_service</a>-&gt;<a class="code" href="class_c_basic_service.html#a697834720e8fea776f366a8207087fa6">SetTimer</a>(*<span class="keyword">this</span>);</div>
<div class="line"><a name="l00080"></a><span class="lineno">   80</span>&#160;}</div>
<div class="line"><a name="l00081"></a><span class="lineno">   81</span>&#160; </div>
<div class="line"><a name="l00082"></a><span class="lineno"><a class="line" href="class_c_timer_base.html#a9bf8e7d97c8eacdbcac56394c19ab510">   82</a></span>&#160;<a class="code" href="tools_8h.html#a798af1e30bc65f319c1a246cecf59e39">DWORD</a> <a class="code" href="class_c_timer_base.html#a9bf8e7d97c8eacdbcac56394c19ab510">CTimerBase::TimerComplete</a>(<a class="code" href="class_c_sock_error.html">CSockError</a> ec, <span class="keywordtype">void</span>* invoker)</div>
<div class="line"><a name="l00083"></a><span class="lineno">   83</span>&#160;{</div>
<div class="line"><a name="l00084"></a><span class="lineno">   84</span>&#160;    <a class="code" href="class_c_timer_base.html">CTimerBase</a>* pThis = (<a class="code" href="class_c_timer_base.html">CTimerBase</a>*)invoker;</div>
<div class="line"><a name="l00085"></a><span class="lineno">   85</span>&#160; </div>
<div class="line"><a name="l00086"></a><span class="lineno">   86</span>&#160;    <a class="code" href="class_shared_ptr.html">SharedPtr&lt;HandleBase&gt;</a> handle;</div>
<div class="line"><a name="l00087"></a><span class="lineno">   87</span>&#160;    handle.<a class="code" href="class_shared_ptr.html#a4d01af086ba301328e14f279a7ab400a">Swap</a>(pThis-&gt;<a class="code" href="class_c_timer_base.html#a45d900ea34b698a1cca78c92a5c5a18d">_tinfo</a>-&gt;handle);</div>
<div class="line"><a name="l00088"></a><span class="lineno">   88</span>&#160;    <span class="keywordflow">return</span> (*(handle))(ec, pThis-&gt;<a class="code" href="class_c_timer_base.html#a45d900ea34b698a1cca78c92a5c5a18d">_tinfo</a>-&gt;invoker);</div>
<div class="line"><a name="l00089"></a><span class="lineno">   89</span>&#160;}</div>
<div class="line"><a name="l00090"></a><span class="lineno">   90</span>&#160; </div>
<div class="line"><a name="l00091"></a><span class="lineno"><a class="line" href="class_c_timer_base.html#a1ea13f83b73eb54062006d563a5c2f85">   91</a></span>&#160;<a class="code" href="class___timeout_info__.html">TimeoutInfo</a>* <a class="code" href="class_c_timer_base.html#a1ea13f83b73eb54062006d563a5c2f85">CTimerBase::GetTimerInfo</a>()</div>
<div class="line"><a name="l00092"></a><span class="lineno">   92</span>&#160;{</div>
<div class="line"><a name="l00093"></a><span class="lineno">   93</span>&#160;    <span class="keywordflow">return</span> <a class="code" href="class_c_timer_base.html#a45d900ea34b698a1cca78c92a5c5a18d">_tinfo</a>.Get();</div>
<div class="line"><a name="l00094"></a><span class="lineno">   94</span>&#160;}</div>
<div class="line"><a name="l00095"></a><span class="lineno">   95</span>&#160; </div>
<div class="line"><a name="l00096"></a><span class="lineno">   96</span>&#160;<a class="code" href="tools_8h.html#ac909db71799bb22cb7d636a34cd785e4">DEF_END_LIBTOOLS</a></div>
</div><!-- fragment --></div><!-- contents -->
<div class="ttc" id="aclass_c_timer_base_html_a6fffc8e98a58289e7ea395cfbf4d73e9"><div class="ttname"><a href="class_c_timer_base.html#a6fffc8e98a58289e7ea395cfbf4d73e9">CTimerBase::SetTimer</a></div><div class="ttdeci">void SetTimer(const CTimeBase &amp;t, const SharedPtr&lt; HandleBase &gt; &amp;func, void *invoker=NullPtr)</div><div class="ttdoc">设置定时器</div><div class="ttdef"><b>Definition:</b> <a href="_timer_8cpp_source.html#l00052">Timer.cpp:52</a></div></div>
<div class="ttc" id="aclass_c_sock_error_html"><div class="ttname"><a href="class_c_sock_error.html">CSockError</a></div><div class="ttdoc">套接字错误信息类</div><div class="ttdef"><b>Definition:</b> <a href="_sock_error_8h_source.html#l00013">SockError.h:13</a></div></div>
<div class="ttc" id="aclass_c_timer_base_html_a1ea13f83b73eb54062006d563a5c2f85"><div class="ttname"><a href="class_c_timer_base.html#a1ea13f83b73eb54062006d563a5c2f85">CTimerBase::GetTimerInfo</a></div><div class="ttdeci">TimeoutInfo * GetTimerInfo()</div><div class="ttdoc">获取底层时间信息</div><div class="ttdef"><b>Definition:</b> <a href="_timer_8cpp_source.html#l00091">Timer.cpp:91</a></div></div>
<div class="ttc" id="aclass_c_timer_base_html_a45d900ea34b698a1cca78c92a5c5a18d"><div class="ttname"><a href="class_c_timer_base.html#a45d900ea34b698a1cca78c92a5c5a18d">CTimerBase::_tinfo</a></div><div class="ttdeci">SharedPtr&lt; TimeoutInfo &gt; _tinfo</div><div class="ttdef"><b>Definition:</b> <a href="_timer_8h_source.html#l00065">Timer.h:65</a></div></div>
<div class="ttc" id="aclass___timeout_info___html_ab87e6474102fccfab419a011948dc677"><div class="ttname"><a href="class___timeout_info__.html#ab87e6474102fccfab419a011948dc677">_TimeoutInfo_::invoker</a></div><div class="ttdeci">void * invoker</div><div class="ttdef"><b>Definition:</b> <a href="_timer_info_8h_source.html#l00045">TimerInfo.h:45</a></div></div>
<div class="ttc" id="aclass_c_timer_base_html_ac635b2ee072a0ccca975d084c0b48f51"><div class="ttname"><a href="class_c_timer_base.html#ac635b2ee072a0ccca975d084c0b48f51">CTimerBase::~CTimerBase</a></div><div class="ttdeci">~CTimerBase()</div><div class="ttdoc">析构函数</div><div class="ttdef"><b>Definition:</b> <a href="_timer_8cpp_source.html#l00012">Timer.cpp:12</a></div></div>
<div class="ttc" id="aclass_c_time_base_html_a045344374dbd744e3bc839b31d552b73ab4ca480006077aa183b9d7602b295a46"><div class="ttname"><a href="class_c_time_base.html#a045344374dbd744e3bc839b31d552b73ab4ca480006077aa183b9d7602b295a46">CTimeBase::machine_time</a></div><div class="ttdef"><b>Definition:</b> <a href="_time_8h_source.html#l00084">Time.h:84</a></div></div>
<div class="ttc" id="aclass_shared_ptr_html"><div class="ttname"><a href="class_shared_ptr.html">SharedPtr&lt; HandleBase &gt;</a></div></div>
<div class="ttc" id="atools_8h_html_adbfeae90dcbc6d1e23fc52bb64339f46"><div class="ttname"><a href="tools_8h.html#adbfeae90dcbc6d1e23fc52bb64339f46">DWORD64</a></div><div class="ttdeci">unsigned long long DWORD64</div><div class="ttdef"><b>Definition:</b> <a href="tools_8h_source.html#l00135">tools.h:135</a></div></div>
<div class="ttc" id="aclass_c_time_base_html"><div class="ttname"><a href="class_c_time_base.html">CTimeBase</a></div><div class="ttdoc">时间基类</div><div class="ttdef"><b>Definition:</b> <a href="_time_8h_source.html#l00078">Time.h:78</a></div></div>
<div class="ttc" id="aclass_c_timer_base_html_a65fe573e241729a9f62bc6757da9f36a"><div class="ttname"><a href="class_c_timer_base.html#a65fe573e241729a9f62bc6757da9f36a">CTimerBase::Cancel</a></div><div class="ttdeci">bool Cancel()</div><div class="ttdoc">取消定时器</div><div class="ttdef"><b>Definition:</b> <a href="_timer_8cpp_source.html#l00020">Timer.cpp:20</a></div></div>
<div class="ttc" id="atools_8h_html_a201ce692c9dca6599e5c12d00167419b"><div class="ttname"><a href="tools_8h.html#a201ce692c9dca6599e5c12d00167419b">DEF_BEG_LIBTOOLS</a></div><div class="ttdeci">#define DEF_BEG_LIBTOOLS</div><div class="ttdef"><b>Definition:</b> <a href="tools_8h_source.html#l00036">tools.h:36</a></div></div>
<div class="ttc" id="aclass___timeout_info___html_a75511436e169d4fbb15885d6c83b646a"><div class="ttname"><a href="class___timeout_info__.html#a75511436e169d4fbb15885d6c83b646a">_TimeoutInfo_::handle</a></div><div class="ttdeci">SharedPtr&lt; HandleBase &gt; handle</div><div class="ttdef"><b>Definition:</b> <a href="_timer_info_8h_source.html#l00044">TimerInfo.h:44</a></div></div>
<div class="ttc" id="aclass_c_basic_service_html_a697834720e8fea776f366a8207087fa6"><div class="ttname"><a href="class_c_basic_service.html#a697834720e8fea776f366a8207087fa6">CBasicService::SetTimer</a></div><div class="ttdeci">virtual void SetTimer(CTimerBase &amp;timer)=0</div></div>
<div class="ttc" id="aclass_shared_ptr_html_a4d01af086ba301328e14f279a7ab400a"><div class="ttname"><a href="class_shared_ptr.html#a4d01af086ba301328e14f279a7ab400a">SharedPtr::Swap</a></div><div class="ttdeci">void Swap(SharedPtr&lt; Ty &gt; &amp;ptr)</div><div class="ttdef"><b>Definition:</b> <a href="_shared_ptr_8h_source.html#l00245">SharedPtr.h:245</a></div></div>
<div class="ttc" id="aclass___timeout_info___html"><div class="ttname"><a href="class___timeout_info__.html">_TimeoutInfo_</a></div><div class="ttdef"><b>Definition:</b> <a href="_timer_info_8h_source.html#l00040">TimerInfo.h:40</a></div></div>
<div class="ttc" id="a_timer_8h_html"><div class="ttname"><a href="_timer_8h.html">Timer.h</a></div></div>
<div class="ttc" id="aclass_c_timer_base_html_afd4814952f219f10b2f06a73fa9cec7d"><div class="ttname"><a href="class_c_timer_base.html#afd4814952f219f10b2f06a73fa9cec7d">CTimerBase::StartTime</a></div><div class="ttdeci">CMachineTime * StartTime(CMachineTime &amp;t)</div><div class="ttdoc">获取定时器被设置的时间</div><div class="ttdef"><b>Definition:</b> <a href="_timer_8cpp_source.html#l00041">Timer.cpp:41</a></div></div>
<div class="ttc" id="aclass_c_timer_base_html"><div class="ttname"><a href="class_c_timer_base.html">CTimerBase</a></div><div class="ttdoc">定时器</div><div class="ttdef"><b>Definition:</b> <a href="_timer_8h_source.html#l00017">Timer.h:17</a></div></div>
<div class="ttc" id="a_timer_info_8h_html"><div class="ttname"><a href="_timer_info_8h.html">TimerInfo.h</a></div></div>
<div class="ttc" id="aclass_c_time_base_html_a045344374dbd744e3bc839b31d552b73a9e6af1eb7377cc41cd74c7abd6807bd6"><div class="ttname"><a href="class_c_time_base.html#a045344374dbd744e3bc839b31d552b73a9e6af1eb7377cc41cd74c7abd6807bd6">CTimeBase::real_time</a></div><div class="ttdef"><b>Definition:</b> <a href="_time_8h_source.html#l00083">Time.h:83</a></div></div>
<div class="ttc" id="aclass_c_machine_time_html_a0959e18a8f5d2e7812f986f2e88fc682"><div class="ttname"><a href="class_c_machine_time.html#a0959e18a8f5d2e7812f986f2e88fc682">CMachineTime::GetTime</a></div><div class="ttdeci">virtual TIME_T GetTime() const</div><div class="ttdoc">返回整型时间,时间格式为从开机时刻起所经过的毫秒数</div><div class="ttdef"><b>Definition:</b> <a href="_time_8cpp_source.html#l00241">Time.cpp:241</a></div></div>
<div class="ttc" id="aclass_c_timer_base_html_aa1353bd6bbfb8fa4a045c4f091ab09e6"><div class="ttname"><a href="class_c_timer_base.html#aa1353bd6bbfb8fa4a045c4f091ab09e6">CTimerBase::_service</a></div><div class="ttdeci">CBasicService * _service</div><div class="ttdef"><b>Definition:</b> <a href="_timer_8h_source.html#l00066">Timer.h:66</a></div></div>
<div class="ttc" id="atools_8h_html_ac909db71799bb22cb7d636a34cd785e4"><div class="ttname"><a href="tools_8h.html#ac909db71799bb22cb7d636a34cd785e4">DEF_END_LIBTOOLS</a></div><div class="ttdeci">#define DEF_END_LIBTOOLS</div><div class="ttdef"><b>Definition:</b> <a href="tools_8h_source.html#l00038">tools.h:38</a></div></div>
<div class="ttc" id="aclass_c_time_base_html_a6667eccaa267178c72d64406484e5aff"><div class="ttname"><a href="class_c_time_base.html#a6667eccaa267178c72d64406484e5aff">CTimeBase::GetTime</a></div><div class="ttdeci">virtual TIME_T GetTime() const =0</div><div class="ttdoc">返回整型时间</div></div>
<div class="ttc" id="aclass_c_basic_service_html_ab87e91381edc59c3118e3cfc89f82f76"><div class="ttname"><a href="class_c_basic_service.html#ab87e91381edc59c3118e3cfc89f82f76">CBasicService::UpdateTimer</a></div><div class="ttdeci">virtual bool UpdateTimer(CTimerBase &amp;timer)=0</div></div>
<div class="ttc" id="aclass_c_timer_base_html_a9bf8e7d97c8eacdbcac56394c19ab510"><div class="ttname"><a href="class_c_timer_base.html#a9bf8e7d97c8eacdbcac56394c19ab510">CTimerBase::TimerComplete</a></div><div class="ttdeci">static DWORD TimerComplete(CSockError ec, void *invoker)</div><div class="ttdoc">定时器处理函数</div><div class="ttdef"><b>Definition:</b> <a href="_timer_8cpp_source.html#l00082">Timer.cpp:82</a></div></div>
<div class="ttc" id="aclass_c_sys_time_html"><div class="ttname"><a href="class_c_sys_time.html">CSysTime</a></div><div class="ttdoc">系统时间类 系统时间以整型的方式传入</div><div class="ttdef"><b>Definition:</b> <a href="_time_8h_source.html#l00124">Time.h:124</a></div></div>
<div class="ttc" id="aclass_c_time_base_html_a7212bf7d0361a0136644701c1a562ce1"><div class="ttname"><a href="class_c_time_base.html#a7212bf7d0361a0136644701c1a562ce1">CTimeBase::GetType</a></div><div class="ttdeci">virtual TimeType GetType() const =0</div><div class="ttdoc">返回时间类型</div></div>
<div class="ttc" id="aclass_c_sys_time_html_a7f7125b905195fa3e9ddc3b3191e89d8"><div class="ttname"><a href="class_c_sys_time.html#a7f7125b905195fa3e9ddc3b3191e89d8">CSysTime::GetTime</a></div><div class="ttdeci">virtual TIME_T GetTime() const</div><div class="ttdoc">返回整型格式系统时间(YYYYMMDDHHmmSSsss)</div><div class="ttdef"><b>Definition:</b> <a href="_time_8cpp_source.html#l00221">Time.cpp:221</a></div></div>
<div class="ttc" id="aclass_c_basic_service_html_a84db55709c4a577a12879202e2788727"><div class="ttname"><a href="class_c_basic_service.html#a84db55709c4a577a12879202e2788727">CBasicService::DelTimer</a></div><div class="ttdeci">virtual void DelTimer(CTimerBase &amp;timer)=0</div></div>
<div class="ttc" id="atools_8h_html_a798af1e30bc65f319c1a246cecf59e39"><div class="ttname"><a href="tools_8h.html#a798af1e30bc65f319c1a246cecf59e39">DWORD</a></div><div class="ttdeci">unsigned int DWORD</div><div class="ttdef"><b>Definition:</b> <a href="tools_8h_source.html#l00134">tools.h:134</a></div></div>
<div class="ttc" id="aclass_c_machine_time_html_a5a9fb922168cf7ebdee0e0ace9ba5896"><div class="ttname"><a href="class_c_machine_time.html#a5a9fb922168cf7ebdee0e0ace9ba5896">CMachineTime::SetTime</a></div><div class="ttdeci">virtual void SetTime(TIME_T t64=0)</div><div class="ttdoc">设置时间,时间格式为从开机时刻起所经过的毫秒数,如果为0则取当前经过的时间</div><div class="ttdef"><b>Definition:</b> <a href="_time_8cpp_source.html#l00246">Time.cpp:246</a></div></div>
<div class="ttc" id="aclass_c_timer_base_html_ad54d1b32d19918127ef78ce3864f59b8"><div class="ttname"><a href="class_c_timer_base.html#ad54d1b32d19918127ef78ce3864f59b8">CTimerBase::CTimerBase</a></div><div class="ttdeci">CTimerBase(CBasicService *service)</div><div class="ttdoc">初始化定时器类，并与tcp服务类进行绑定</div><div class="ttdef"><b>Definition:</b> <a href="_timer_8cpp_source.html#l00007">Timer.cpp:7</a></div></div>
<div class="ttc" id="atools_8h_html_ab689500aaec0db066e3ac9483d3fe425"><div class="ttname"><a href="tools_8h.html#ab689500aaec0db066e3ac9483d3fe425">NullPtr</a></div><div class="ttdeci">#define NullPtr</div><div class="ttdef"><b>Definition:</b> <a href="tools_8h_source.html#l00119">tools.h:119</a></div></div>
<div class="ttc" id="aclass_c_timer_base_html_ae8f782500c3f8ade2436dbd8189f0328"><div class="ttname"><a href="class_c_timer_base.html#ae8f782500c3f8ade2436dbd8189f0328">CTimerBase::Reset</a></div><div class="ttdeci">bool Reset()</div><div class="ttdoc">重置定时器</div><div class="ttdef"><b>Definition:</b> <a href="_timer_8cpp_source.html#l00031">Timer.cpp:31</a></div></div>
<div class="ttc" id="aclass_c_machine_time_html"><div class="ttname"><a href="class_c_machine_time.html">CMachineTime</a></div><div class="ttdoc">机器时间类</div><div class="ttdef"><b>Definition:</b> <a href="_time_8h_source.html#l00149">Time.h:149</a></div></div>
<div class="ttc" id="aclass_c_basic_service_html"><div class="ttname"><a href="class_c_basic_service.html">CBasicService</a></div><div class="ttdoc">服务类 基类</div><div class="ttdef"><b>Definition:</b> <a href="_service_base_8h_source.html#l00015">ServiceBase.h:15</a></div></div>
<div class="ttc" id="a_timer_info_8h_html_ad138624af884b17f15fe7c857f59a5c3"><div class="ttname"><a href="_timer_info_8h.html#ad138624af884b17f15fe7c857f59a5c3">TimeoutInfo</a></div><div class="ttdeci">_TimeoutInfo_ TimeoutInfo</div></div>
<div class="ttc" id="a_service_base_8h_html"><div class="ttname"><a href="_service_base_8h.html">ServiceBase.h</a></div></div>
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
制作者 &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.16
</small></address>
</body>
</html>
